package com.probiz.estore.common.model.order.base;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.common.model.system.ShippingMethod;
import com.probiz.estore.core.model.BaseObject;

/**
 * OrderExpress Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 */
public class OrderExpressTbl extends BaseObject implements Serializable {

    protected Integer orderExpressId;
	protected String orderExpressName;
	protected Integer width;
	protected Integer height;
	protected String templateData;
	protected String backgroundImageUrl;
	protected Integer sortOrder;
	protected Short status;
	protected ShippingMethod shippingMethod;
	protected java.util.Date createTime;
	protected java.util.Date updateTime;
	protected Integer version;


	/**
	 * Default Empty Constructor for class OrderExpress
	 */
	public OrderExpressTbl () {
		super();
	}
	
	/**
	 * Default Key Fields Constructor for class OrderExpress
	 */
	public OrderExpressTbl (
		 Integer in_orderExpressId
        ) {
		this.setOrderExpressId(in_orderExpressId);
    }

    

	/**
	 * 唯一标识	 * @return Integer
     * @hibernate.id column="orderExpressId" type="java.lang.Integer" generator-class="native"
	 */
	public Integer getOrderExpressId() {
		return this.orderExpressId;
	}
	
	/**
	 * Set the orderExpressId
	 */	
	public void setOrderExpressId(Integer aValue) {
		this.orderExpressId = aValue;
	}	

	/**
	 * 快递单名称	 * @return String
	 * @hibernate.property column="orderExpressName" type="java.lang.String" length="100" not-null="true" unique="false"
	 */
	public String getOrderExpressName() {
		return this.orderExpressName;
	}
	
	
	

	public ShippingMethod getShippingMethod() {
		return shippingMethod;
	}

	public void setShippingMethod(ShippingMethod shippingMethod) {
		this.shippingMethod = shippingMethod;
	}
	

    /**
     * * @return Integer
     */
    public Integer getShippingMethodId() {
        return this.getShippingMethod() == null ? null : this.getShippingMethod().getShippingMethodId();
    }

    /**
     * Set the productTypeId
     */
    public void setShippingMethodId(Integer aValue) {
        if (aValue == null) {
        	shippingMethod = null;
        } else {
        	shippingMethod = new ShippingMethod(aValue);
        	shippingMethod.setVersion(Integer.valueOf(0));//set a version to cheat hibernate only
        }
    }

	/**
	 * Set the orderExpressName
	 * @spring.validator type="required"
	 */	
	public void setOrderExpressName(String aValue) {
		this.orderExpressName = aValue;
	}	

	/**
	 * 宽度	 * @return Integer
	 * @hibernate.property column="width" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getWidth() {
		return this.width;
	}
	
	/**
	 * Set the width
	 * @spring.validator type="required"
	 */	
	public void setWidth(Integer aValue) {
		this.width = aValue;
	}	

	/**
	 * 高度	 * @return Integer
	 * @hibernate.property column="height" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getHeight() {
		return this.height;
	}
	
	/**
	 * Set the height
	 * @spring.validator type="required"
	 */	
	public void setHeight(Integer aValue) {
		this.height = aValue;
	}	

	/**
	 * 定位数据	 * @return String
	 * @hibernate.property column="templateData" type="java.lang.String" length="2147483647" not-null="false" unique="false"
	 */
	public String getTemplateData() {
		return this.templateData;
	}
	
	/**
	 * Set the templateData
	 */	
	public void setTemplateData(String aValue) {
		this.templateData = aValue;
	}	

	/**
	 * 快递单背景图片	 * @return String
	 * @hibernate.property column="backgroundImageUrl" type="java.lang.String" length="128" not-null="false" unique="false"
	 */
	public String getBackgroundImageUrl() {
		return this.backgroundImageUrl;
	}
	
	/**
	 * Set the backgroundImageUrl
	 */	
	public void setBackgroundImageUrl(String aValue) {
		this.backgroundImageUrl = aValue;
	}	

	/**
	 * 排序	 * @return Integer
	 * @hibernate.property column="sortOrder" type="java.lang.Integer" length="10" not-null="false" unique="false"
	 */
	public Integer getSortOrder() {
		return this.sortOrder;
	}
	
	/**
	 * Set the sortOrder
	 */	
	public void setSortOrder(Integer aValue) {
		this.sortOrder = aValue;
	}	

	/**
	 * 状态	 * @return Short
	 * @hibernate.property column="status" type="java.lang.Short" length="5" not-null="false" unique="false"
	 */
	public Short getStatus() {
		return this.status;
	}
	
	/**
	 * Set the status
	 */	
	public void setStatus(Short aValue) {
		this.status = aValue;
	}	

	/**
	 * 创建时间	 * @return java.util.Date
	 * @hibernate.property column="createTime" type="java.util.Date" length="19" not-null="true" unique="false"
	 */
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	/**
	 * Set the createTime
	 * @spring.validator type="required"
	 */	
	public void setCreateTime(java.util.Date aValue) {
		this.createTime = aValue;
	}	

	/**
	 * 更新时间	 * @return java.util.Date
	 * @hibernate.property column="updateTime" type="java.util.Date" length="19" not-null="true" unique="false"
	 */
	public java.util.Date getUpdateTime() {
		return this.updateTime;
	}
	
	/**
	 * Set the updateTime
	 * @spring.validator type="required"
	 */	
	public void setUpdateTime(java.util.Date aValue) {
		this.updateTime = aValue;
	}	

	/**
	 * 版本记录	 * @return Integer
	 * @hibernate.property column="version" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getVersion() {
		return this.version;
	}
	
	/**
	 * Set the version
	 * @spring.validator type="required"
	 */	
	public void setVersion(Integer aValue) {
		this.version = aValue;
	}	

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof OrderExpressTbl)) {
			return false;
		}
		OrderExpressTbl rhs = (OrderExpressTbl) object;
		return new EqualsBuilder()
				.append(this.orderExpressId, rhs.orderExpressId)
				.append(this.orderExpressName, rhs.orderExpressName)
				.append(this.width, rhs.width)
				.append(this.height, rhs.height)
				.append(this.templateData, rhs.templateData)
				.append(this.backgroundImageUrl, rhs.backgroundImageUrl)
				.append(this.sortOrder, rhs.sortOrder)
				.append(this.status, rhs.status)
				.append(this.createTime, rhs.createTime)
				.append(this.updateTime, rhs.updateTime)
				.append(this.version, rhs.version)
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.orderExpressId) 
				.append(this.orderExpressName) 
				.append(this.width) 
				.append(this.height) 
				.append(this.templateData) 
				.append(this.backgroundImageUrl) 
				.append(this.sortOrder) 
				.append(this.status) 
				.append(this.createTime) 
				.append(this.updateTime) 
				.append(this.version) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("orderExpressId", this.orderExpressId) 
				.append("orderExpressName", this.orderExpressName) 
				.append("width", this.width) 
				.append("height", this.height) 
				.append("templateData", this.templateData) 
				.append("backgroundImageUrl", this.backgroundImageUrl) 
				.append("sortOrder", this.sortOrder) 
				.append("status", this.status) 
				.append("createTime", this.createTime) 
				.append("updateTime", this.updateTime) 
				.append("version", this.version) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "orderExpressId";
	}
	
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return orderExpressId;
	}

}